package com.tang.model.adpater.login.v1;

import com.tang.model.adpater.login.LoginService;
import com.tang.model.adpater.login.ResultMsg;

/**
 * @Author tangyuan2meicloud.com
 * @DATE 2021/8/25 20:50
 * @Desc
 * @Remarks
 */
public class LoginForThirdAdapter extends LoginService implements ILoginForThird {
    @Override
    public ResultMsg loginForQQ(String openId) {
        System.out.println("QQ登录");
        return loginForRegist( openId,null);
    }

    @Override
    public ResultMsg loginForWX(String openId) {
        System.out.println("微信登录");
        return loginForRegist( openId,null);
    }

    @Override
    public ResultMsg loginForAli(String openId) {
        System.out.println("阿里云登录");
        return loginForRegist( openId,null);
    }

    private ResultMsg loginForRegist(String username,String password){
        if(null == password){
            password = "THIRD_EMPTY";
        }
        super.regist(username,password);
        return super.login(username,password);
    }
}
